/****************************************************
 * Description: ServiceImpl for 课程
 * Copyright:   Copyright (c) 2014
 * Company:     beiwaionline
 * @author      bfsu
 * @version     1.0
 * @see
	HISTORY
    *  2014-01-10 bfsu Create File
**************************************************/

package com.bfsuol.common.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bfsuolframework.security.dao.BaseUserDAO;
import com.bfsuolframework.security.entity.BaseUser;
import com.bfsuolframework.security.entity.dto.TreeNode;
import com.bfsuolframework.core.service.ServiceSupport;

import com.bfsuol.common.service.IndexService;


@Service
public class IndexServiceImpl extends ServiceSupport<BaseUser> implements IndexService {

    @Autowired
    private BaseUserDAO baseUserDAO;
    
    @Override
    public BaseUserDAO getDao() {
        return baseUserDAO;
    }

    /* (non-Javadoc)
     * @see com.bfsuol.lms2014.common.service.IndexService#findMenuTreeByUserId()
     */
	public List<TreeNode> findMenuTreeByUserId(Long userId){
    	BaseUser user = baseUserDAO.getById(userId);
    	/*if(user != null){
    		Collection<Role> roles = user.getRoles();
    		String[] roleCodes = new String[roles.size()];
    		for(int i=0;i<=roles.size();i++){
    			roleCodes[i] = roles
    		}
    	}
    	SecurityContext.getRolesMenu(roleCodes);*/
    	return null;
    }
}